import pysvn
import os

last_make_pack_revision = 11
src_path = "../src"

client = pysvn.Client()
start = pysvn.Revision(pysvn.opt_revision_kind.number, last_make_pack_revision)
end = pysvn.Revision(pysvn.opt_revision_kind.base)
diff_list = client.diff_summarize_peg(src_path, pysvn.Revision(pysvn.opt_revision_kind.unspecified), start, end)
path_set = set()
for diff_elem in diff_list:
    path = src_path + '/' + diff_elem.data['path']
    kind = diff_elem.data['summarize_kind']
    print(kind)
    print(path)
    last_dot_pos = path.rfind('.')
    last_slash_pos = path.rfind('/')
    if last_dot_pos != -1 and last_slash_pos < last_dot_pos: #文件才处理，文件夹不处理
        folderPath = path[0:last_slash_pos]
        path_set.add(folderPath)
deleted_path_set = set()
changed_path_set = set()
for path in path_set:
    if os.path.exists(path):
        changed_path_set.add(path)
    else:
        deleted_path_set.add(path)
print('changed folder:')
print(changed_path_set)
print('deleted folder:')
print(deleted_path_set)